



/**
 * 销售报价单主表类型
 */
export interface SalesQuotation {
    id: number;
    bjDate: Date;
    cid: number | null;
    bjName: string;
    uid: number;
    status: number;
    totalQuantity: number;
    totalAmount: number;
    totalTaxValue: number;
    notes: string;
    createBy: string;
    createTime: Date;
    updateBy: string;
    updateTime: Date;
    isDelete: number;
    doCode: string;
    did: number;
    typeId: number
}

/**
 * 销售报价单明细表类型
 */
export interface SalesQuotationDetail {
    id: number;
    bjCode: string;
    goodId: number;
    quantity: number;
    discountRate: number;
    notes: string;
    createBy: string;
    createTime: Date;
    updateBy: string;
    updateTime: Date;
    isDelete: number;
    actualPrice: number
    taxAmount: number
}

export interface QuotationQueryParams {
    doCode?: string;
    bjName?: string;
    startDate?: Date;
    endDate?: Date;
    page?: number;
    pageSize?: number;
}

export interface SalesOrder {
    id: number;
    docCode: string;
    docDate: Date;
    cid: number | null;
    uid: number | null;
    did: number | null;
    status: number;
    totalQuantity: number;
    totalAmount: number;
    totalTaxValue: number;
    notes: string;
    createBy: string;
    createTime: Date;
    updateBy: string;
    updateTime: Date;
    isDelete: 0 | 1;
    insStatus: number;
    sourceSheet: string;
    typeId: number;
    arBalance: number
}

export interface SalesOrderDetail {
    id: number;
    xsOrderCode: string;
    goodId: number;
    quantity: number;
    discountRate: number;
    notes: string;
    createBy: string;
    createTime: Date;
    updateBy: string;
    updateTime: Date;
    isDelete: number;
    warehouseId: number;
    shippedQuantity: number;
    actualPrice: number;
}

export interface SalesOut {
    id: number;
    code: string;
    orderDate: Date;
    sourceCode: string;
    cid: number;
    did: number;
    uid: number;
    orderStatus: number;
    storeManId: number;
    outStoreNum: number;
    orderType: number;
    notes?: string | null; // 可能为空的字段
    goodsId: number;
    storeId: number;
    sumPrice: number;
    taxSumPrice: number;
    unitCol: number;
    sumCost: number;
    createDate: Date;
    createUser: string;
    updateUser?: string | null;
    updateDate?: string | null;
    isDelete: 0 | 1;
}


export interface SalesOutDetail {
    id: number;
    goodId: number;
    storeId: number;
    outStoreNum: number;
    taxSumPrice: number;
    sumPrice: number;
    sourceCode: string;
    notes: string;
    createUser: string;
    createTime: Date;
    updateUser: string;
    updateTime: Date;
    isDelete: 0 | 1;

}

export interface SalesReturn {
    id: number
    docCode: string//单据编码
    docDate: Date//单据日期
    cid: number | null//客户id
    customerAddress: string//客户地址
    uid: number//员工id
    totalReturnAmount: number
    actualReturnAmount: number
    remainAccount: number
    status: number
    notes: string
    createBy: string
    createTime: Date
    updateBy: string
    updateTime: Date
    isDelete: number
    sourceSheet: string
    did: number
    typeId: number
}

export interface SalesReturnDetail {
    id: number
    xsReturnCode: string    // 主表编码
    goodId: number          // 商品ID
    quantity: number
    discountRate: number   // 使用camelCase
    notes: string
    createBy: string
    createTime: Date
    updateBy: string
    updateTime: Date
    isDelete: number       // 建议使用布尔类型
    warehouseId: number
    shippedQuantity: number // decimal类型可选
    returnReason: string
    returnQuantity: number
    returnStatus: number
    actualPrice: number;
}

//销售应收对象
export interface SalesReceivable {
    id: number
    docCode: string
    docDate: Date
    cid: number | null
    uid: number
    did: number
    totalAmount: number//应收总金额
    receivedAmount: number//已收金额
    balanceAmount: number//未收金额
    dueDate: Date
    status: number
    notes: string
    createBy: string
    createTime: Date
    updateBy: string
    updateTime: Date
    isDelete: number
    settledAmount: number
    unsettledAmount: number
    sourceSheet: string
    typeId: number
    typeColor: number
}


export interface SalesCollection {
    id: number,
    docCode: string,
    docDate: Date,
    cid: number | null,
    uid: number | null,
    collectionAmount: number//收款金额
    sourceSheet: string
    status: number
    notes: string
    createBy: string
    createTime: Date
    updateBy: string
    updateTime: Date
    isDelete: number
    did: number | null
    settledTotalAmount: number//收款核销总金额
    details: SalesCollectiondetail[],
    typeId: 15
}


export interface SalesCollectiondetail {
    id: number
    collectionCode: string
    collectionAmount: number//本次收款金额
    discountAmount: string//本次折扣
    notes: string//
    createTime: Date
    createBy: string
    updateTime: Date
    updateBy: string
    sourceSheet: string
    isDelete: number
    accountId: number
    payId: number
    fee: number

}

//销售收款退款对象
export interface SalesCollectionRefund {
    id: number
    docDate: Date
    docCode: string
    status: number
    cid: number | null
    refundAmount: number
    verRefundAmount: number
    refundAccount: string
    refundWay: string
    uid: number
    createBy: string
    createTime: Date
    updateBy: string
    updateTime: Date
    did: number
    isDelete: number
    details: SalesCollectionRefunddetail[],
    typeId: number

}

export interface SalesCollectionRefunddetail {
    id: number
    mainCode: string
    refundName: string
    refundAmount: number
    verAmount: number
    taxRate: number
    taxAmount: number
    notes: string
    createTime: Date
    updateTime: Date
    sourceSheet: String
    createBy: String
    updateBy: String
    refundAccount: number
    refundWay: number
    isDelete: number
}

//销售预收单对象
export interface SalesAdvance {
    id: number,
    docCode: string,
    docDate: Date,
    cid: number | null,
    uid: number | null,
    advanceAmount: number,
    status: number,
    notes: string,
    createBy: string,
    createTime: Date,
    updateBy: string,
    updateTime: Date,
    isDelete: number,
    settledAmount: number,
    unsettledAmount: number,
    sourceSheet: string,
    typeId: number,
    did: number | null,
    uidStr: string,
    didStr: string,
    cidStr: string,
    details: SalesAdvanceDetail[];
}

//销售预收单明细对象
export interface SalesAdvanceDetail {
    id: number,
    mainCode: string,
    advanceType: number,
    advanceName: number,
    bankAccount: number,
    amount: number,
    createBy: string,
    createTime: Date,
    updateBy: string,
    updateTime: Date,
    isDelete: number,
    notes: string,
    fee: number
}

//预收单退款对象
export interface SalesAdvanceRefund {
    id: number,
    docCode: string,
    docDate: Date,
    cid: number | null,
    uid: number,
    refundTotalAmount: number,
    status: number,
    createBy: string,
    createTime: Date,
    updateBy: string,
    updateTime: Date,
    isDelete: number,
    notes: string
    sourceSheet: string,
    typeId: number
    did: number,
    uidStr: string,
    didStr: string,
    cidStr: string,
    details: SalesAdvanceRefundDetail[]
}

//预收单退款明细对象
export interface SalesAdvanceRefundDetail {
    id: number,
    mainCode: string,
    advanceType: number,
    advanceName: number,
    bankAccount: string,
    amount: number,
    createBy: string,
    createTime: Date,
    updateBy: string,
    updateTime: Date,
    isDelete: number

}




